#pragma once
#include <memory>
#include "cfcdef.h"
#include "cfcgl.h"
#include "UIBuf.h"
using std::shared_ptr;
using std::vector;
class CDiv
{
protected:
    Format _default;
    CUIBuf* _UIBuf;
    Coord _absolute_pos;
    Coord _pos;
    Coord _size;
    CDiv* ParentElement;
    CDiv* next;
    CDiv* prev;
    CDiv* ChildBegin;
    CDiv* ChildEnd;
    Relation _relation;
    size_t _zIndex;
    bool _visible;
    virtual void _Show(bool visible);
public:
    bool userSelect;
    virtual void Show(bool visible);
    virtual void AppendChild(CDiv* div);
    virtual void RemoveChild(CDiv* div);
    virtual void onload();
    virtual bool onkeydown(char ch);
    virtual void onfocus();
    virtual void onleave();
    virtual void onresize();
    virtual void UpdateData(bool isDown);
    virtual void BackgroundColor(Color color);
    virtual void BackgroundColor(Color r, Color g, Color b);
    virtual void uiupd();
    virtual void SetPos(Coord pos);
    virtual void resize(Coord size);
    virtual void SetRel(Relation pos);
    virtual void SetzIndex(size_t zIndex);
    friend void cfcgl::NextTab();
    friend void cfcgl::LastTab();
    CDiv();
    ~CDiv();
};




